package com.wyhello.tube4.spring.model;

import java.util.List;

import com.wyhello.tube4.facade.TubeFacade;
import com.wyhello.tube4.pojo.Reside;
import com.wyhello.tube4.pojo.Working;

public class WorkingRecordsModel {
	private TubeFacade facade;

	public TubeFacade getFacade() {
		return facade;
	}

	public void setFacade(TubeFacade facade) {
		this.facade = facade;
	}
	/**
	 * 保存运行记录
	 * @param working
	 * @return
	 */
	public boolean saveWorking(Working working){
		return facade.saveWorking(working);
	}
	
	/**
	 * 对运行记录进行修改
	 * @param working
	 * @return
	 */
	public boolean updateWorking(Working working){
		return facade.updateWorking(working);
	}
	/**
	 * 删除运行记录
	 * @return
	 */
	public int deleteWorking(String ids){
		return facade.deleteWorking(ids);
	}
	/**
	 * 查询运行记录
	 * @return
	 */
	public List<Working> queryWorking(){
		return facade.queryWorking();
	}
	/**
	 * 根据ID查询锅炉
	 * @param 锅炉ID
	 * @return
	 */
	public Reside getResideById(int id){
		return facade.getResideById(id);
	}
	/**
	 * 添加运行记录前查询锅炉信息
	 * 查询锅炉的信息
	 * @return
	 */
	public List<Reside> queryResideByBoiler(){
		return facade.queryResideByBoiler();
	}
	/**
	 * 根据锅炉ID查询运行记录
	 * @return
	 */
	public List<Working> queryWorkingByResideId(int resideId){
		return facade.queryWorkingByResideId(resideId);
	}
	/**
	 * 根据锅炉ID查询有结束日期
	 * @param working 锅炉id
	 * @return 信息列表
	 */
	public List<Working> queryWorkingEndByResideId(int resideId){
		return facade.queryWorkingEndByResideId(resideId);
	}
	/**
	 * 根据锅炉Id查询锅炉是否运行
	 * @param resideId
	 * @return true运行
	 */
	public boolean queryNoWorkingEndByResideId(int resideId){
		return facade.queryNoWorkingEndByResideId(resideId);
	}
}
